/**
 * 字典表格式化
 * @param {Array} list 
 */
function transformFilters(list) {
  if (!list) return [];
  return list.map(item => ({
    value: item.value,
    label: item.dname,
  }));
}

function sourceList(state) {
  let sourceDict = state.dictTree.find(val => val.type === 'cluing_source') || {};
  return transformFilters(sourceDict.children);
}

function statusList(state) {
  let statusDict = state.dictTree.find(val => val.type === 'cluing_status') || {};
  return transformFilters(statusDict.children);
}

function industryList(state) {
  let industryDict = state.dictTree.find(val => val.type === 'customer_industry') || {};
  console.log(industryDict)
  return transformFilters(industryDict.children);
}

export {
  sourceList,
  statusList,
  industryList,
}

